<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>

<h:form  rendered="#{currentUser.teacher}">
	<h:panelGrid columns="2" columnClasses="labelText, normalText">
		<h:outputText value="Zajecia" />
		<h:outputText value="#{eventCurrentBean.event.series.kind}" />
		<h:outputText value="Miejsce" />
		<h:outputText value="#{eventCurrentBean.event.place}" />
		<h:outputText value="Poczatek" />
		<h:outputText value="#{eventCurrentBean.event.startDate}">
			<f:convertDateTime pattern="dd-MM-yyyy HH:mm" />
		</h:outputText>
		<h:outputText value="Koniec" />
		<h:outputText value="#{eventCurrentBean.event.endDate}">
			<f:convertDateTime pattern="dd-MM-yyyy HH:mm" />
		</h:outputText>
	</h:panelGrid>
	<h:dataTable binding="#{eventCurrentBean.dataTable}" value="#{eventCurrentBean.event.attendences}" var="attendence"  headerClass="tableHeader" styleClass="dataTable" rowClasses="oddRow, evenRow">
		<h:column>
			<f:facet name="header">
				<h:outputText value="Student" />
			</f:facet>
				<h:outputText value="#{attendence.student.name}" />
		</h:column>
		<h:column>
			<f:facet name="header">
				<h:outputText value="Grupa" />
			</f:facet>
				<h:outputText value="#{attendence.student.projectGrp.groupName}" />
		</h:column>
		<h:column>
			<f:facet name="header">
				<h:outputText value="Obecnosc" />
			</f:facet>
				<h:selectBooleanCheckbox value="#{attendence.pressence}" />
		</h:column>
	</h:dataTable>
	<h:commandButton value="Zapisz" action="#{eventCurrentBean.updateAttendence}" />
	<h:commandButton value="Idz do listy grup" action="nav_current_event_groups" />
</h:form>